<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.siloam.module.User" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../jeasyui/themes/gray/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../jeasyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../../css/manager.css" />

<script type="text/javascript" src="../../jeasyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../../jeasyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../jeasyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../js/win.js"></script>
<title>人员管理</title>
<script type="text/javascript">

	function addUser(){
		openUrl("新增人员", 400, 300, "addUser.jsp");
	}

	function editUser(){
		selectOneOpenUrl("#dg","user.do?method=initEdit", 400, 300, "修改", "人员");
	}

	function deleteUser(){
		checkSelectSomeDoAction("#dg", "删除", "用户", "user.do?method=delSome", true);
	}

	function leave(){
		checkSelectSomeDoAction("#dg", "设置", "用户离开", "user.do?method=setStatus&status=<%=User.STATUS_LEAVE%>", false);
	}

	function disable(){
		checkSelectSomeDoAction("#dg", "禁用", "用户", "user.do?method=setStatus&status=<%=User.STATUS_INVALID%>", false);
	}

	function enable(){
		checkSelectSomeDoAction("#dg", "启用", "用户", "user.do?method=setStatus&status=<%=User.STATUS_STAY%>", false);
	}
	
	function reloadDg(){
		$("#dg").datagrid("reload");
		closeWin();
	}
	
</script>
</head>
<body>
<div class="dg-content">
	<table id="dg" class="easyui-datagrid" title="人员列表"
		data-options="rownumbers:true,pagination:true,
			fitColumns:true,iconCls:'icon-users',url:'user.do?method=listUser'">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'id',hidden:true"></th>
				<th data-options="field:'name',width:100,align:'center'">姓名</th>
				<th data-options="field:'username',width:80,align:'center'">用户名</th>
				<th data-options="field:'qq',width:80,align:'center'">QQ</th>
				<th data-options="field:'status',width:60,align:'center'">状态</th>
				<!--<th data-options="field:'opt',width:60,align:'center'">操作</th>-->
			</tr>
		</thead>
	</table>
</div>
<div class="dg-foot">
	<div class='dg-toolbar'>
		<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addUser()">新增</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">修改</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteUser()">删除</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" plain="true" onclick="enable()">启用</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="leave()">离开</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-no" plain="true" onclick="disable()">禁用</a>
	</div>
</div>
</body>
</html>